﻿@model List<Property>

@if (Model.Count > 0)
{
    Property color = ViewBag.Color;
    string categoryNameId = ViewBag.CategoryNameId;
    string productNameId = ViewBag.ProductNameId;

    <div class="form-group form-color">
        <span class="title">Màu: </span> <span class="value">@color.Name</span>
        <br />
        @foreach (Property prop in Model)
        {
            string active = prop.Id == color.Id ? "active" : "";
            string url = Url.Action("Details", new
            {
                productNameId = productNameId,
                categoryNameId = categoryNameId,
                color = prop.NameId
            });

            if (!String.IsNullOrWhiteSpace(active))
            {
                @Html.Hidden("Color", prop.NameId)
            }

            <a href="@url" class="btn btn-default @active" style="background-color: @prop.Value" title="@prop.Name"></a>
        }
    </div>
}
